<template>
  <div class="wraper">
    <swiper :options="swiperOption">
    <!-- slides -->
      <swiper-slide v-for="item in list" :key="item.id"><img class="swipe-img" :src="item.imgUrl"></swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: 'HomeSwiper',
  props: {
    list: {
      type: Array
    }
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      }
    }
  },
  created () {
    // console.log(this.list)
    // console.log('hahah')
  }
}
</script>
<style lang="stylus" scoped>
.wraper >>> .swiper-pagination-bullet-active //由于scope的原因 需要做穿透才能选中样式
  background #fff !important
.wraper
  overflow hidden
  width 100%
  height 31.25% //给高度是因为避免出现闪 的视觉效果
  // padding-bottom 31.25%
  background #ccc //背景图片没有显示出来的时候显示成灰色
  .swipe-img
    width 100%
</style>
